package com.glp.work.flow;


import com.glp.utils.message.notify.annotation.EnableMailService;
import com.glp.utils.message.notify.annotation.EnableSmsService;
import com.glp.work.flow.utils.SpringUtil;
import org.springframework.amqp.rabbit.annotation.EnableRabbit;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.Import;
import org.springframework.retry.annotation.EnableRetry;
import org.springframework.scheduling.annotation.EnableAsync;
import tk.mybatis.spring.annotation.MapperScan;

@SpringBootApplication
@EnableDiscoveryClient
/**扫描 mybatis mapper 包路径*/
@MapperScan(basePackages = "com.glp.work.flow.mapper")
/** 扫描 所有需要的包, 包含一些自用的工具类包 所在的路径*/
@ComponentScan(basePackages = {"com.glp"})
@EnableAutoConfiguration(exclude = SecurityAutoConfiguration.class)
@EnableFeignClients
@EnableMailService
@EnableSmsService
@EnableRetry
@EnableRabbit
@Import(value = {SpringUtil.class})  //引入SpringUtil
@EnableAsync
public class WorkFlowApplication {
    /**
     * 注册Spring Util
     * 这里为了和上一个冲突，所以方面名为：springUtil2
     * 实际中使用springUtil
     */
    @Bean
    public SpringUtil springUtil2() {
        return new SpringUtil();
    }


    public static void main(String[] args) {
        SpringApplication.run(WorkFlowApplication.class, args);
    }
}
